<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ZonghengDecoratorDesc
 *
 * @author Implement <hdjahs@qq.com>
 */
class ZonghengDecoratorDesc {
    private $obj;

    public function __construct(Zongheng $obj) {
        $this->obj = $obj;
        $this->init();
    }

    private function init() {
        $tool = Tool::getIns();
        $desc = $tool->strCutByStr($this->obj->result, '<p class="j_info">', '</p>');
        $desc = strip_tags($desc);
        $desc = substr($desc, 0, strrpos($desc, '。')) . '。';
        $this->obj->str .= "\n" . trim($desc);
    }
}
